<%- include(versionCheckTemplate, { version: '1.0.0' }) %>
  let cc;
  function setLoadingDisplay() {

  var splash = document.getElementById('splash');
  var box_right = document.getElementById("box_right");
  var box_left = document.getElementById("box_left");
  var proNum = 0;
  var percentNum = 0;
  const interTime = setInterval(() => {
  proNum += 10;
  console.log("proNum:" + proNum + " percentNum:" + percentNum);
  if (proNum > percentNum) {
  // progressBar.style.height = proNum + '%';
  // text.innerText = proNum + '%';
  var percent = proNum;
  var ro = percent / 50 * 180;
  box_right.style.transform = `rotate(${ro}deg)`;
  }
  if (proNum >= 50 || percentNum >= 50) {
  clearInterval(interTime);
  }
  },10);

  // cc.assetManager.preloadAny('c6750199-c67c-422e-bf5d-d09bb006695d',(completedCount, totalCount, item) => {
  // console.log("completedCount:" + completedCount + " totalCount:" + totalCount + " item:" + item);
  // if (totalCount > 10) {
  // var percent = 100 * completedCount / totalCount;
  // var ro = percent / 50 * 180;
  // if (percent < 50) { // box_right.style.transform=`rotate(${ro}deg)`; // } else { //
    box_right.style.transform=`rotate(${180}deg)`; // box_left.style.transform=`rotate(${ro}deg)`; // } // } // });
    splash.style.display='block' ; cc.director.once(cc.Director.EVENT_BEFORE_SCENE_LOADING,function() {
    box_right.style.transform="rotate(" .concat(180, "deg)" ); box_left.style.transform="rotate(" .concat(320, "deg)" );
    }); cc.director.once(cc.Director.EVENT_BEFORE_SCENE_LAUNCH,function() { box_right.style.transform="rotate("
    .concat(180, "deg)" ); box_left.style.transform="rotate(" .concat(360, "deg)" ); });
    cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function () { console.log("开始启动首屏幕");
    splash.style.display='none' ; let time=Date.now(); console.log("enter cocos time is ", time);
        let obj = {
            eventName: " game_enter_cocos", time, name: 'match3d' , }; window.NDB.sendAutoJoinEvent &&
    window.NDB.sendAutoJoinEvent(obj); }); } export class Application { constructor () {
    this.settingsPath='<%= settingsJsonPath %>' ; this.showFPS=<%=showFPS %>;
    }

    init (engine) {
    cc = engine;
    cc.game.onPostBaseInitDelegate.add(this.onPostInitBase.bind(this));
    cc.game.onPostSubsystemInitDelegate.add(this.onPostSystemInit.bind(this));
    setLoadingDisplay();
    }

    onPostInitBase () {
    // cc.settings.overrideSettings('assets', 'server', '');
    // do custom logic
    }

    onPostSystemInit () {
    // do custom logic
    }

    start () {
    return cc.game.init({
    debugMode: <%= debugMode %> ? cc.DebugMode.INFO : cc.DebugMode.ERROR,
      settingsPath: this.settingsPath,
      overrideSettings: {
      // assets: {
      // preloadBundles: [{ bundle: 'main', version: 'xxx' }],
      // }
      profiling: {
      showFPS: this.showFPS,
      }
      }
      }).then(() => cc.game.run());
      }
      }